
// import { Device } from '@ionic-native/device';
// import { JPush } from "@jiguang-ionic/jpush";

//import { WelcomePage } from './welcome/welcome';
import { EmojiPickerModule } from "@ionic-tools/emoji-picker";
import { ShopOverPage } from "./../pages/shop-over/shop-over";
import { WelcomePageModule } from "../pages/welcome/welcome.module";
import { HomePage } from "./../pages/home/home";
import { NgModule, ErrorHandler } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import {
  IonicApp,
  IonicModule,
  IonicErrorHandler,
  Config
} from "ionic-angular";
import { HttpModule } from "@angular/http";
import { MyApp } from "./app.component";
import { ScreenOrientation } from "@ionic-native/screen-orientation";
import { TabsPage } from "../pages/tabs/tabs";
import { StatusBar } from "@ionic-native/status-bar";
import { SplashScreen } from "@ionic-native/splash-screen";
import { HttpService } from "../providers/HttpService";
import { DataService } from "../providers/DataService";
import { StorageService } from "../providers/StorageService";
import { Camera, CameraOptions } from "@ionic-native/camera";
import { Crop } from "@ionic-native/crop";
import { GlobalData } from "../providers/GlobalData";
import { Network } from "@ionic-native/network";

import { ImagePicker } from "@ionic-native/image-picker";

import { Logger } from "../providers/Logger";
import { IonicStorageModule } from "@ionic/storage";

//import { IdChangeCompComponent } from '../components/id-change-comp/id-change-comp';
import { NativeService } from "../providers/NativeService";
import { Transfer, TransferObject } from "@ionic-native/transfer";
import { AppVersion } from "@ionic-native/app-version";
import { File } from "@ionic-native/file";
import { PhotoLibrary } from "@ionic-native/photo-library";
import { InAppBrowser } from "@ionic-native/in-app-browser";
import { FileOpener } from "@ionic-native/file-opener";
import { LocalNotifications } from "@ionic-native/local-notifications";
import { FileService } from "../providers/FileService";
import { BackButtonService } from "../providers/backButtonService";
import { ComponentsModule } from "../components/components.module";
import {
  ModalFromRightEnter,
  ModalFromRightLeave,
  ModalScaleEnter,
  ModalScaleLeave
} from "./modal-transitions";

import { MultiPickerModule } from "ion-multi-picker";
import { FilePath } from "@ionic-native/file-path";
import { HeadfacePage } from "../pages/personal/headface/headface";
import { CallNumber } from "@ionic-native/call-number";

import { ImageResizer, ImageResizerOptions } from "@ionic-native/image-resizer";
// import { ChangeSubjectProvider } from '../providers/change-subject/change-subject';

import { QRScanner } from "@ionic-native/qr-scanner";
import { Geolocation } from "@ionic-native/geolocation";
import { FileTransfer, FileTransferObject } from "@ionic-native/file-transfer";
import * as ionicGalleryModal from "ionic-gallery-modal";
import { HAMMER_GESTURE_CONFIG } from "@angular/platform-browser";
import { UploadServiceProvider } from "../providers/upload-service/upload-service";
import { SelectMorePicturePageModule } from "../shared/select-more-picture/select-more-picture.module";
import { BackButtonProvider } from "../providers/back-button/back-button";

import { Alipay, AlipayOrder } from '@ionic-native/alipay';
import { HTTP } from '@ionic-native/http';
// import { BackBottonServiceProvider } from '../providers/back-botton-service/back-botton-service';

// import { BackButtonService } from '../providers/backButton'
@NgModule({
  declarations: [MyApp, TabsPage],
  imports: [
    BrowserModule,
    HttpModule,
    ComponentsModule,
    MultiPickerModule,
    ionicGalleryModal.GalleryModalModule,
    //IonicModule.forRoot(MyApp, { mode: "ios", tabsHideOnSubPages: true, backButtonText: '返回', }),
    IonicModule.forRoot(MyApp, {
      mode: "ios",
      tabsHideOnSubPages: true,
      backButtonText: ""
    }),
    IonicStorageModule.forRoot(),
    EmojiPickerModule.forRoot(),
    WelcomePageModule
  ],
  bootstrap: [IonicApp],
  entryComponents: [MyApp, TabsPage],
  providers: [
    StatusBar,
    SplashScreen,
    DataService,
    HttpService,
    StorageService,
    BackButtonService,
    Camera,
    Crop,
    Alipay,
    // JPush,
    // Device,
    {
      provide: HAMMER_GESTURE_CONFIG,
      useClass: ionicGalleryModal.GalleryModalHammerConfig
    },
    // BackButtonService,
    QRScanner,
    ImageResizer,
    Geolocation,
    HTTP,
    CallNumber,
    GlobalData,
    Network,
    SelectMorePicturePageModule,
    ImagePicker,
    Logger,
    FileService,
    ScreenOrientation,
    FilePath,
    PhotoLibrary,
    NativeService,
    Transfer,
    AppVersion,
    File,
    FileTransfer,
    FileTransferObject,
    InAppBrowser,
    FileOpener,
    LocalNotifications,
    { provide: ErrorHandler, useClass: IonicErrorHandler },
    UploadServiceProvider,
    BackButtonProvider

    // ChangeSubjectProvider
  ]
})
export class AppModule {
  constructor(public config: Config) {
    this.setCustomTransitions();
  }

  private setCustomTransitions() {
    this.config.setTransition("modal-from-right-enter", ModalFromRightEnter);
    this.config.setTransition("modal-from-right-leave", ModalFromRightLeave);
    this.config.setTransition("modal-scale-enter", ModalScaleEnter);
    this.config.setTransition("modal-scale-leave", ModalScaleLeave);
  }
}
